package com.mswyt.utils.msDataSource.dto;

import lombok.Data;

import java.io.Serializable;

/**
 * @ClassName: MsDataSourceMsgDto
 * @Description: 数据源信息
 */
@Data
public class MsDataSourceMsgDto implements Serializable {
    private String driverClassName;
    private String jdbcUrl;
    private String username;
    private String password;
    //true表示默认使用的数据源
    private Boolean isDefault;

    public MsDataSourceMsgDto(String jdbcUrl, String username, String password) {
        this.driverClassName = "com.mysql.cj.jdbc.Driver";
        this.jdbcUrl = jdbcUrl;
        this.username = username;
        this.password = password;
        this.isDefault = false;
    }

    public MsDataSourceMsgDto(String jdbcUrl, String username, String password, Boolean isDefault) {
        this.driverClassName = "com.mysql.cj.jdbc.Driver";
        this.jdbcUrl = jdbcUrl;
        this.username = username;
        this.password = password;
        this.isDefault = isDefault;
    }

    public MsDataSourceMsgDto(String jdbcUrl, String username, String password, Boolean isDefault, String driverClassName) {
        this.driverClassName = driverClassName;
        this.jdbcUrl = jdbcUrl;
        this.username = username;
        this.password = password;
        this.isDefault = isDefault;
    }
}
